<?php
class Admin_PaymentController extends My_Controller_Admin_Choix
{
	public function indexAction()
	{
	    $model = Mage::getModel('admin/payment');

		$this->view->collection = $model->getCollection();
	}

	public function editAction()
	{
	    $id = $this->_getParam('id', 0);
	    $object = Mage::getModel('admin/payment');
	    if ($id) {
	        $object->load($id);
	    }
	    $this->view->object = $object;
	}

	public function newAction()
	{
	    $this->_forward('edit');
	}

	public function saveAction()
	{
	    $id = $this->_getParam('id');
	    $model = Mage::getModel('admin/payment');
	    if ($id) {
	        $model->load($id);
	    }
	    $data = $this->_getParam('data');
	    $model->addData($data)->save();
	    $this->_redirect('admin/payment/?num_vente=' . $this->view->numVente);
	    exit;
	}

	public function deleteAction()
	{
	    $id = $this->_getParam('id');
	    Mage::getModel('admin/payment')->load($id)->delete();
	    $this->_redirect('admin/payment/?num_vente=' . $this->view->numVente);
	    exit;
	}
}

